package com.designpattern.secondchapter.one;

public class CurrentConditionsDisplay implements /*Observer,*/ DisplayElement{
	
	private float temp;
	private float humidity;
	private Subject weatherData;
	public CurrentConditionsDisplay(Subject weatherData) {
		this.weatherData = weatherData;
		weatherData.registerOberver(new Observer() {
			
			@Override
			public void update(float temp, float humidity, float pressure) {
				CurrentConditionsDisplay.this.temp = temp;
				CurrentConditionsDisplay.this.humidity = humidity;
				display() ;
			}
		});
	}

	@Override
	public void display() {
		System.out.println("Current conditions: " + temp + "   humidity: " + humidity);
		
	}

	/*@Override
	public void update(float temp, float humidity, float pressure) {
		
		
	}*/

}
